#include <stdlib.h>
#include <iostream>
using std::cout;
using std::endl;

void display(){
    cout << "display()" << endl;
}
void print(){
    cout << "print()" << endl;
}


void test0(){
    //使用atexit注册函数，让其在程序退出时被自动调用
    //先注册的后调用
    atexit(print);
    atexit(display);
}

int main(void){
    cout << "start" << endl;
    test0();
    cout << "end" << endl;
    return 0;
}
